<?php
/*
$url = array(
	'http://adsense.clicking.com.tw/ads_cm.php?q=美容&search_type=COSTCOBBS_940117_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=COSTCOBBS_940156_1'
	);
*/
	$url = array(
	'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_cm.php?search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=英語學習&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_46815_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_250250_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72890_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1',
'http://adsense.clicking.com.tw/ads_pm.php?q=遊學&search_type=YAMOL_72860_1'
	);
	
    foreach ($url as $key=>$url_term) {
    	
        $user_agent = array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)');
        shuffle($user_agent);
        $sleep_sec_pool = array(0.5, 2, 1, 1.5, 2, 2, 3, 0.5, 1.5, 1.5, 3, 1.5, 0.5, 1);
        $ref = array('http://adsense.clicking.com.tw', 'http://adsense.clicking.com.tw');
        $curl = curl_init();
        shuffle($sleep_sec_pool);
        shuffle($ref);
        sleep($sleep_sec_pool[0]);
        //error_log($url);
        // Setup headers - I used the same headers from Firefox version 2.0.0.6
        // below was split up because php.net said the line was too long. :/
        $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
        $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
        $header[] = "Cache-Control: max-age=0";
        $header[] = "Connection: keep-alive";
        $header[] = "Keep-Alive: 300";
        $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
        $header[] = "Accept-Language: en-us,en;q=0.5";
        $header[] = "Pragma: "; // browsers keep this blank.
        
        curl_setopt($curl, CURLOPT_URL, $url_term);
        curl_setopt($curl, CURLOPT_USERAGENT, $user_agent[0]);
        
        curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
        curl_setopt($curl, CURLOPT_REFERER, $ref[0]);
        curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
        curl_setopt($curl, CURLOPT_AUTOREFERER, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        
        $html = curl_exec($curl); // execute the curl command
        curl_close($curl); // close the connection
    }
?>